<?php
namespace app\sw\model;

use think\Model;

class SheetTemplateModel extends Model{
    protected $name = 'sw_sheet_template';
    protected $pk = 'id';


    public function department(){
        return $this->hasOne(DepartmentModel::class, 'id', 'department_id');
    }


    public function fields(){
        return $this->hasMany(SheetTemplateFieldModel::class, 'sheet_template_id', 'id');
    }
    
    public function cloumn(){
        return $this->hasMany(SheetTemplateCloumnModel::class, 'sheet_template_id', 'id');
    }
}   